<?php
function static_content_default(){
    //
    global $CONTACT;
    $url = getCurrentRequestParameters('url');
    
    $contentMapper = new staticContent_Mapper();
    $obj = $contentMapper->findByUrl($url);
    if(!$obj){
        header("HTTP/1.0 404 Not Found");
        echo "Pagina pe care o cautati nu exista";
        exit;
    }
    $tpl = XTemplate::getInstance();    
    $template = "modules/static_content/static_module.html";
  
    $body = $obj->getBody();
     $body = str_replace(array('{CONTACT_ADRESA}', '{CONTACT_EMAIL1}', '{CONTACT_EMAIL2}','{CONTACT_TELEFON}'),
        array($CONTACT['CONTACT_ADRESA'], $CONTACT['CONTACT_EMAIL1'], $CONTACT['CONTACT_EMAIL2'],$CONTACT['CONTACT_TELEFON']),
        $body);
    $tpl->assign_file('CONTENT',$template);
    $tpl->assign('moduleTitle', $obj->getTitle());
    $tpl->assign('moduleContent', $body);
    $tpl->assign('metaKeywords', $obj->getMetaKeywords() );
    $tpl->assign('metaDescription', $obj->getMetaDescription() );
    $tpl->assign('metaTitle', $obj->getTitle());
    $tpl->parse('main.metaKeywords');
    $tpl->parse('main.metaTitle');
    $tpl->parse('main.metaDescription');
    $tpl->parse('main.module_title');

}
?>
